<template>
  <div class="header">
    <el-row>
      <div class="left">
        <el-button type="danger" class="el-icon-s-fold"></el-button>
        <span class="breadcrumb">
            <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item><a href="/">后台首页</a></el-breadcrumb-item>
        </el-breadcrumb>
        </span>
        <el-button size="small " icon="el-icon-back" circle></el-button>
      </div>
      <div class="right">
        <el-dropdown>
          <span class="el-dropdown-link">
            {{username}}<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item>账号信息</el-dropdown-item>
            <el-dropdown-item>退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </el-row>
  </div>
</template>

<script>
export default {
    data() {
        return {
            username:'admin'
        }
    },
    created(){
        this.username=JSON.parse(localStorage.getItem('userInfo')).username;
    }
};
</script>

<style>
.el-header {
  padding: 0;
}
.left{
    float: left;
    margin-left: 20px;
}
.right{
    float: right;
    margin-right: 20px;
}
.breadcrumb{
    margin: 0 20px;
    display: inline-block;
}
.header {
  background: #fff;
  height: 60px;
  line-height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
</style>